#include <stdio.h>
#define LENGTH 10

int main(){
    int arr[LENGTH] = {1, 2, 3, 4, 5 ,6 ,7 ,8 , 9, 9};
    int arr_reversed[LENGTH];

    // 用一个辅助数组倒序遍历原来数组
    for(int i = 0; i < LENGTH; i++){
        arr_reversed[i] = arr[LENGTH - i - 1];
    }

    // 原地转换
    for(int i = 0; i < LENGTH / 2; i++){
        int tem = arr[LENGTH - i - 1];
        arr[LENGTH - i - 1] = arr[i];
        arr[i] = tem;
    }

    for(int i = 0; i < LENGTH; i++){
        printf("arr_reversed:%d\n", arr_reversed[i]);        
    }
    for(int i = 0; i < LENGTH; i++){
        printf("arr:%d\n", arr[i]);        
    }

    return 0;

}